<?php
/**
 * FastApp.
 * 8/13/24
 * @Author 深色的海 (wx:deepsea_0024)
 * @Contact telegram:deepsea159 
 */

namespace App\Fastapp\Api\Controller\Pay;

use App\Fastapp\Api\Controller\ApiController;
use App\Fastapp\Api\Service\Pay\Platform\ShPayService;
use App\Fastapp\Api\Service\Pay\Platform\XwinpayService;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\PostMapping;
use Psr\Http\Message\ResponseInterface;


#[Controller('api/pay/callback')]
class CallbackController extends ApiController
{

    #[PostMapping('shPayed')]
    public function shPayed(): ResponseInterface
    {
        return $this->response->raw(ShPayService::payed($this->request->all()))->withHeader('Content-type', 'text/plain');
    }

    #[PostMapping('xwinpay')]
    public function xwinpay(): ResponseInterface
    {
        return $this->response->raw(XwinpayService::payed($this->request->all()))->withHeader('Content-type', 'text/plain');
    }
}